<template>
  <div class="titbox" v-if="bools == true">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane :label="item.text" :name="String(item.id)" v-for="(item, index) in activeItemList" :key="index">
        <div v-if="item.id == 'store_1'">
          <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
            <el-form-item label="门店名称" label-width="150px" prop="store_name">
              <el-input style="width: 98%" v-model="ruleForm.store_name"></el-input>
            </el-form-item>
            <el-form-item label="座位类别" label-width="150px" prop="type">
              <el-select v-model="ruleForm.type" @change="$forceUpdate()" style="width: 98%" multiple placeholder="请选择">
                <el-option v-for="item in options" :key="item.id" :label="item.title" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="联系电话" label-width="150px" prop="phone">
              <el-input style="width: 98%" v-model="ruleForm.phone"></el-input>
            </el-form-item>
            <el-form-item label="营业时间" prop="startTime1" label-width="150px">
              <el-time-picker is-range v-model="startTime1" :clearable="true" format="HH:mm" value-format="HH:mm"
                @input="changetabs" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"
                placeholder="选择时间范围">
              </el-time-picker>
              <!-- <el-col :span="10">
                <el-form-item prop="start_time">
                  <el-time-select
                    placeholder="选择时间"
                    style="width:646px;"
                    v-model="ruleForm.start_time"
                    :picker-options="{
                      start: '00:00',
                      step: '00:30',
                      end: '24:00',
                      maxTime: ruleForm.end_time
                    }"
                  ></el-time-select>
                </el-form-item>
              </el-col>
              <el-col class="line" :span="1">-</el-col>
              <el-col :span="10">
                <el-form-item prop="end_time">
                  <el-time-select
                    placeholder="选择时间"
                    style="width:646px;"
                    v-model="ruleForm.end_time"
                    :picker-options="{
                      start: '00:00',
                      step: '00:30',
                      end: '24:00',
                      minTime: ruleForm.start_time
                    }"
                  ></el-time-select>
                </el-form-item>
              </el-col> -->
            </el-form-item>
            <el-form-item label="休息日" label-width="150px" prop="restday">
              <div class="inpts">
                <span style="cursor: pointer" @click="installdate">设置休息日</span>
              </div>
            </el-form-item>
            <!-- <el-form-item label="座位解锁时间" label-width="150px" prop="unlock_time"> -->
            <!-- <el-time-select
                v-model="ruleForm.unlock_time"
                style="width: 98%;"
                :picker-options="{
                start: '00:00',
                step: '00:30',
                end: '24:00'
                }"
                placeholder="选择时间"
              ></el-time-select> -->
            <!-- <el-input placeholder="请输入解锁时间" style="width:98%;" v-model="ruleForm.unlock_time"></el-input> -->
            <!-- </el-form-item> -->
            <!-- <el-form-item label="选座时间颗粒度" label-width="150px" prop="choose_time">
              <el-input placeholder="请输入时间值" style="width:98%" v-model="ruleForm.choose_time">
                <template slot="append">分钟</template>
</el-input>
</el-form-item>-->
            <el-form-item label="门店地址" label-width="150px" prop="address">
              <el-input placeholder="请输入地址" style="width: 98%" v-model="ruleForm.address"></el-input>
            </el-form-item>
            <el-form-item label="开门距离" label-width="150px" prop="distance">
              <el-input placeholder="请输入开门距离" style="width: 98%" v-model="ruleForm.distance">
                <template slot="append">米</template>
              </el-input>
            </el-form-item>
            <el-form-item label="Wi-Fi 信息" label-width="150px">
              <el-col :span="10">
                <el-form-item prop="wifi_name">
                  <el-input placeholder="请输入Wi-Fi名称" v-model="ruleForm.wifi_name"></el-input>
                </el-form-item>
              </el-col>
              <el-col class="line" :span="1">-</el-col>
              <el-col :span="10">
                <el-form-item prop="wifi_code">
                  <el-input placeholder="请输入Wi-Fi密码" v-model="ruleForm.wifi_code"></el-input>
                </el-form-item>
              </el-col>
            </el-form-item>
            <!-- <el-form-item label="客服微信" label-width="150px" prop="wx_code">
              <el-col :span="10">
                <el-input placeholder="请输入客服微信" v-model="ruleForm.wx_code"></el-input>
              </el-col>
            </el-form-item> -->
            <el-form-item label="客服链接" label-width="150px" prop="wechat_link">
              <el-col :span="10">
                <el-input placeholder="请输入客服链接" v-model="ruleForm.wechat_link"></el-input>
              </el-col>
            </el-form-item>
            <el-form-item label="设备设施" label-width="150px" prop="facility_id">
              <el-select v-model="ruleForm.facility_id" style="width: 98%" @change="$forceUpdate()" multiple
                placeholder="请选择">
                <el-option v-for="item in options1" :key="item.id" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="到店指引" label-width="150px" prop="guide">
              <el-button type="warning" size="mini" style="display: inline-block; margin-right: 10px"
                @click="lookimg">查看指引图片</el-button>
              <!-- <el-button type="primary" size="mini" @click="upimg">上传指引图片</el-button> -->
              <el-upload style="display: inline-block" action="https://m.sapiki.com//admin/common/imageUpload"
                :show-file-list="false" :on-success="handlestore" :before-upload="beforeAvatarUpload">
                <el-button size="mini" type="primary">上传指引图片</el-button>
              </el-upload>
            </el-form-item>
            <div id="container" class="mapbox"></div>
            <el-button type="primary" size="mini" style="
                float: right;
                margin-right: 20px;
                margin-bottom: 40px;
                margin-top: 40px;
              " @click="saveformdata('ruleForm')">修改</el-button>
          </el-form>
          <!-- <Map @addressInfo="getAddress" /> -->
        </div>
        <div v-if="item.id == 'store_5'">
          <div class="contbox">
            <div class="flex_bottombox">
              <div class="tit1">
                <span class="tx1">门店图片</span>
                <span class="tx2">*用于展示在小程序门店首页的轮播图</span><span
                  style="font-size: 12px; color: #afafaf; margin-left: 10px">(尺寸宽750*高750)</span>
              </div>
              <div class="tx3" v-if="!isdel" @click="showbtns">管理</div>
              <div class="tx3" v-else @click="showbtns">取消</div>
              <div style="display: flex">
                <draggable dragClass="ghost" :forceFallback="true" v-model="fileLists" chosenClass="chosen"
                  animation="500" @start="onStart" @end="onEnd">
                  <transition-group>
                    <div class="item" v-for="element in fileLists" :key="element">
                      <img style="width: 100%; height: 100%; border-radius: 6px" :src="element.url" alt />
                      <img v-if="isdel" src="../../../assets/img/delimg.png" @click="delimg(element.url)" style="
                          width: 20px;
                          height: 20px;
                          position: absolute;
                          right: 0;
                          cursor: auto;
                        " alt="" />
                    </div>
                  </transition-group>
                </draggable>
                <div style="display: inline-block">
                  <el-upload action="https://m.sapiki.com//admin/common/imageUpload" list-type="picture-card"
                    :show-file-list="false" :on-preview="handlePictureCardPreview" :on-success="handcardsuccess"
                    :before-upload="beforeAvatarUpload" :on-remove="handleRemove">
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </div>
              </div>
            </div>
            <div class="flex_bottombox">
              <div class="tit1">
                <span class="tx1">位置分布图</span>
                <span class="tx2">*用于展示在预约界面的位置分布图</span><span
                  style="font-size: 12px; color: #afafaf; margin-left: 10px">(尺寸宽750*高750)</span>
              </div>
              <el-upload :file-list="imageUrlarr" class="avatar-uploader"
                action="https://m.sapiki.com//admin/common/imageUpload" list-type="picture-card"
                :class="uploadDisabled ? 'disabled' : ''" :on-preview="handlePictureCardPreviews"
                :on-change="handleChange" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"
                :on-remove="handleRemoveposi" :limit="1">
                <i class="el-icon-plus"></i>
                <!-- <img v-if="imageUrl" :src="imageUrl" class="avatar" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
              </el-upload>
              <el-dialog :visible.sync="dialogVisiblepaths">
                <img width="100%" :src="imageUrl" alt="" />
              </el-dialog>
            </div>
            <div class="flex_bottombox">
              <div class="tit1">
                <span class="tx1">学习群二维码</span>
                <span class="tx2">*用于展示在小程序的群二维码</span><span
                  style="font-size: 12px; color: #afafaf; margin-left: 10px">(尺寸宽750*高750)</span>
              </div>
              <el-upload :file-list="imageUrlsarr" class="avatar-uploader" :class="uploadDisabled1 ? 'disabled' : ''"
                action="https://m.sapiki.com//admin/common/imageUpload" list-type="picture-card"
                :on-preview="handlePictureCardPrestudy" :on-change="handleChange1" :on-success="handlequnAvatarSuccess"
                :before-upload="beforeAvatarUpload" :on-remove="handleRemovestudy" :limit="1">
                <i class="el-icon-plus"></i>
                <!-- <img v-if="imageUrls" :src="imageUrls" class="avatar" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
              </el-upload>
              <el-dialog :visible.sync="dialogVisiblepath1">
                <img width="100%" :src="imageUrls" alt="" />
              </el-dialog>
            </div>
            <div class="flex_bottombox">
              <div class="tit1">
                <span class="tx1">活动图</span>
                <span class="tx2">*用于活动展示</span><span
                  style="font-size: 12px; color: #afafaf; margin-left: 10px">(尺寸宽750*高750)</span>
              </div>
              <el-upload :file-list="imageUrlatvarr" class="avatar-uploader" :class="uploadDisabled2 ? 'disabled' : ''"
                action="https://m.sapiki.com//admin/common/imageUpload" list-type="picture-card"
                :on-change="handleChange2" :on-preview="handlePictureCardPrehis" :on-success="handleatvAvatarSuccess"
                :before-upload="beforeAvatarUpload" :on-remove="handleRemovehis" :limit="1">
                <i class="el-icon-plus"></i>
                <!-- <img v-if="imageUrlatv" :src="imageUrlatv" class="avatar" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
              </el-upload>
              <el-dialog :visible.sync="dialogVisiblepath2">
                <img width="100%" :src="imageUrlatv" alt="" />
              </el-dialog>
            </div>
            <div class="flex_bottombox">
              <div class="tit1">
                <span class="tx1">物联门禁</span>
              </div>
              <div class="box1">
                <span style="
                    color: #919191;
                    font-size: 14px;
                    width: 120px;
                    margin-left: 30px;
                    display: inline-block;
                  ">门禁名称</span>
                <span style="color: #333333; font-size: 14px">{{
                  avcReturndata.door_name
                  }}</span>
              </div>
              <div class="box1">
                <span style="
                    color: #919191;
                    font-size: 14px;
                    width: 120px;
                    margin-left: 30px;
                    display: inline-block;
                  ">门禁绑定</span>
                <img v-if="
                    avcReturndata.door_Mac == null ||
                    avcReturndata.door_Mac == '' ||
                    avcReturndata.door_Mac == undefined
                  " src="../../../assets/img/error.png" style="width: 14px; height: 14px" alt />
                <img v-else src="../../../assets/img/dui.png" style="width: 14px; height: 14px" alt />
              </div>
              <div class="box1">
                <span style="
                    color: #919191;
                    font-size: 14px;
                    width: 120px;
                    margin-left: 30px;
                    display: inline-block;
                  ">门禁设备ID</span>
                <span style="color: #333333; font-size: 14px">{{
                  avcReturndata.door_Mac
                  }}</span>
              </div>
              <div class="box1">
                <span style="
                    color: #919191;
                    font-size: 14px;
                    width: 120px;
                    margin-left: 30px;
                    display: inline-block;
                  ">开门</span>
                <el-button type="danger" @click="openDoor1(avcReturndata.door_Mac)">开门</el-button>
                <!-- <el-button type="danger" @click="openthedoor">开门</el-button> -->
              </div>
              <!-- <div class="box1">
                <span style="width:120px;margin-left:30px;display:inline-block"></span>
                <el-button type="primary" @click="chageequipment">换绑设备</el-button>
              </div> -->
            </div>
            <div class="flex_bottombox">
              <div class="tit1">
                <span class="tx1">货柜信息</span>
              </div>
              <div class="box1">
                <span style="
                    color: #919191;
                    font-size: 14px;
                    width: 120px;
                    margin-left: 30px;
                    display: inline-block;
                  ">货柜编号</span>
                <el-input style="width: 200px" placeholder="请填写货柜编号" v-model="avcReturndata.container_code"></el-input>
              </div>
            </div>
            <div class="flex_bottombox">
              <div class="tit1">
                <span class="tx1">设备说明</span>
              </div>
              <div style="display: flex; width: 100%; flex-wrap: wrap">
                <div style="
                    margin-right: 300px;
                    margin-bottom: 100px;
                    margin-top: 20px;
                    display: flex;
                    align-items: center;
                  " v-for="(item, index) in avcReturndata.facility" :key="index">
                  <div style="
                      color: #919191;
                      font-size: 14px;
                      width: 100px;
                      margin-right: 70px;
                      margin-left: 30px;
                      display: inline-block;
                      text-align: right;
                    ">
                    {{ item.name }}
                  </div>
                  <!-- <span style="color:#919191;font-size:14px;white-space: nowrap;">{{item.content}}</span> -->
                  <el-input type="textarea" :rows="2" @change="changecont(item)" v-model="item.content"></el-input>
                  <!-- <el-button type="text" @click="coninstall(item)">设备详情</el-button> -->
                </div>
              </div>
            </div>
            <div class="flex_bottombox">
              <div class="tit1">
                <span class="tx1">自习守则</span>
                <span class="tx2">*用于展示在预订成功后的自习守则</span>
              </div>
              <quill-editor ref="editor" v-model="avcReturndata.conduct" class="myQuillEditor"
                :options="editorOption" />
            </div>
            <el-button type="primary" @click="saveseniorEdit"
              style="margin-top: 40px; margin-left: 10px; margin-bottom: 60px">保存</el-button>
          </div>
        </div>
        <div v-if="item.id == 'store_12'">
          <div style="float: right; margin-right: 20px">
            <el-button type="primary" v-if="store_13" @click="addseat">添加座位</el-button>
            <el-button type="primary" v-if="store_14" @click="typeinstall">类别配置</el-button>
          </div>
          <el-table :data="seattableData" style="width: 100%">
            <el-table-column type="index" label="序号" width="100px"></el-table-column>
            <el-table-column prop="genre_type" label="类别"></el-table-column>
            <el-table-column prop="seat_name" label="座位编号"></el-table-column>
            <el-table-column prop="genre_price" label="价格"></el-table-column>
            <el-table-column prop="lamp_status" label="启用">
              <template slot-scope="scope" style="display: flex; align-items: center">
                <el-switch v-model="scope.row.check" @change="operation(scope.row)" active-color="#409EFF"
                  inactive-color="#DCDFE6"></el-switch>
                <!-- <img
                  src="../../../assets/img/dui.png"
                  v-if="scope.row.status==1"
                  style="width:14px;height:14px;margin-right:6px;"
                  alt
                />
                <img
                  src="../../../assets/img/error.png"
                  v-else
                  style="width:14px;height:14px;margin-right:6px;"
                />-->
              </template>
            </el-table-column>
            <!-- <el-table-column prop="lamp_code" label="设备编号"></el-table-column> -->
            <!-- <el-table-column prop="lamp_type" label="设备类型"></el-table-column> -->
            <!-- <el-table-column prop="lamp_id" label="设备">
              <template slot-scope="scope" style="display:flex;align-items: center;">
                <el-switch
                  v-model="scope.row.lamp_id"
                  disabled="true"
                  active-value="1"
                  inactive-value="0"
                  active-color="#409EFF"
                  inactive-color="#ff4949"
                ></el-switch>
              </template>
            </el-table-column>-->
            <el-table-column label="操作">
              <template slot-scope="scope">
                <!-- <el-button
                  v-if="scope.row.lamp_id==1"
                  @click.native.prevent="confirmcancel(scope.row)"
                  type="text"
                >取消绑定</el-button>-->
                <!-- <el-button v-else @click.native.prevent="confirmcancel(scope.row)" type="text">绑定</el-button> -->
                <!-- <el-button
                  v-if="scope.row.status==1&&store_28"
                  @click.native.prevent="operation(scope.row)"
                  type="text"
                >停用</el-button>
                <el-button
                  v-else
                  @click.native.prevent="operation(scope.row)"
                  style="color:#FF9800"
                  type="text"
                >启用</el-button>-->
                <el-button v-if="store_30" @click.native.prevent="editseat(scope.row)" type="text">编辑</el-button>
                <el-button v-if="store_29" @click.native.prevent="deleted(scope.row)" type="text">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
          <div style="width: 100%; text-align: center; margin: 50px auto">
            <el-pagination background :page-size="10" :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper" :total="totle" @size-change="handleSizeChange"
              @current-change="fenyeBtn"></el-pagination>
          </div>
        </div>
        <div v-if="item.id == 'store_16'">
          <div style="float: right; margin-right: 20px">
            <el-button type="primary" @click="addroom" v-if="store_17">添加房间</el-button>
          </div>
          <el-table :data="roomtableData" style="width: 100%">
            <el-table-column prop="room_name" label="房间名称"></el-table-column>
            <el-table-column prop="num" label="可坐人数"></el-table-column>
            <!-- <el-table-column prop="advance_time" label="提前预约天数"></el-table-column> -->
            <el-table-column prop="set_time" label="可预约天数"></el-table-column>
            <el-table-column prop="price" label="价格"></el-table-column>
            <el-table-column prop="minutes" label="最少分钟"></el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button v-if="store_19" @click.native.prevent="
                    addappointmentstate(scope.$index, scope.row)
                  " type="text">添加预约</el-button>
                <el-button @click.native.prevent="showimg(scope.row)" type="text">相册</el-button>
                <el-button v-if="store_17" @click.native.prevent="editroom(scope.$index, scope.row)"
                  type="text">编辑</el-button>
                <el-button v-if="store_18" @click.native.prevent="del(scope.row)" type="text">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
          <div style="width: 100%; text-align: center; margin: 50px auto">
            <el-pagination background :page-size="10" :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper" :total="totle2" @size-change="handleSizeChange2"
              @current-change="fenyeBtn2"></el-pagination>
          </div>
        </div>
        <div v-if="item.id == 'store_20'">
          <div style="float: right; margin-right: 20px">
            <el-button type="primary" v-if="store_24" @click="addcontainer">添加货柜</el-button>
            <el-button type="primary" v-if="store_23" @click="containerinstall">货柜收费设置</el-button>
            <el-button type="primary" v-if="store_32" @click="shuaguide">刷新货柜</el-button>
          </div>
          <el-table :data="containertableData" style="width: 100%">
            <el-table-column prop="devno" label="柜子编号"></el-table-column>
            <el-table-column prop="lockno" label="锁号"></el-table-column>
            <el-table-column prop="show_number" label="显示号"></el-table-column>
            <el-table-column prop="posno" label="货格名称"></el-table-column>
            <el-table-column prop="nickname" label="当前用户"></el-table-column>
            <el-table-column prop="free_time" label="使用时间"></el-table-column>
            <el-table-column prop="stateno" label="使用中">
              <template slot-scope="scope">
                <img src="../../../assets/img/dui.png" v-if="scope.row.stateno == 1" style="width: 14px; height: 14px"
                  alt />
                <img src="../../../assets/img/error.png" v-else style="width: 14px; height: 14px" alt />
              </template>
            </el-table-column>
            <el-table-column prop="status" label="启用">
              <template slot-scope="scope">
                <img src="../../../assets/img/dui.png" v-if="scope.row.status == 1" style="width: 14px; height: 14px"
                  alt />
                <img src="../../../assets/img/error.png" v-else style="width: 14px; height: 14px" alt />
              </template>
            </el-table-column>
            <el-table-column label="操作" width="300px">
              <template slot-scope="scope">
                <el-button @click.native.prevent="editgui(scope.row)" type="text">编辑</el-button>
                <el-button @click.native.prevent="stopuse(scope.row)" v-if="scope.row.status == 1 && store_21"
                  :disabled="scope.row.stateno == 1" type="text">停用</el-button>
                <el-button @click.native.prevent="stopuse(scope.row)" :disabled="scope.row.stateno == 1"
                  v-if="scope.row.status == 2 && store_21" type="text">启用</el-button>
                <el-button type="text" v-if="store_33" @click="opengui(scope.row)">开柜</el-button>
                <el-button @click.native.prevent="incabinet(scope.row)" :disabled="scope.row.stateno == 1"
                  type="text">占柜</el-button>
                <el-button @click.native.prevent="cancelincabinet(scope.row)" :disabled="scope.row.stateno == 2"
                  type="text">取消占柜</el-button>

                <el-button :disabled="scope.row.stateno == 1" @click.native.prevent="delcabinet(scope.row)" type="text"
                  v-if="store_22">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
          <div style="width: 100%; text-align: center; margin: 50px auto">
            <el-pagination background :page-size="10" :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper" :total="totle3" @size-change="handleSizeChange3"
              @current-change="fenyeBtn3"></el-pagination>
          </div>
        </div>
        <div v-if="item.id == 'store_25'">
          <div style="float: right; margin-right: 20px">
            <el-button type="primary" @click="controlinstall">门禁配置</el-button>
          </div>
          <el-table :data="accessableData" style="width: 100%">
            <el-table-column prop="code" label="门禁编号"></el-table-column>
            <el-table-column prop="name" label="门禁名称"></el-table-column>
            <el-table-column prop="type" label="门禁类型"></el-table-column>
            <el-table-column prop="status" label="在线状态">
              <template slot-scope="scope">
                <span v-if="scope.row.status == 1">在线</span>
                <span v-else>离线</span>
              </template>
            </el-table-column>
            <el-table-column prop="manage_type" label="管理类型"></el-table-column>
            <el-table-column prop="Mac" label="管理对象"></el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button @click.native.prevent="opendoor(scope.row)" type="text">开门</el-button>
                <el-button @click.native.prevent="deldoor(scope.row)" v-if="store_26" type="text">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-tab-pane>
    </el-tabs>
    <el-dialog title="设置休息日" :visible.sync="dialogVisible" width="50%">
      <el-switch v-model="value" active-color="#409EFF" inactive-color="#ff4949" @change="swichange"></el-switch>
      <span v-if="bool == false" style="margin-left: 14px; color: #333333; font-size: 14px">点击开启临时休息日</span>
      <span v-else style="margin-left: 14px; color: #333333; font-size: 14px">点击关闭临时休息日</span>
      <div v-if="bool == true" style="margin-top: 30px; margin-left: 90px">
        <span style="color: #333333; font-size: 14px; margin-right: 16px">设置临时休息日</span>
        <el-date-picker v-model="value1" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
          start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
      </div>
      <div style="
          text-align: center;
          color: #333333;
          font-size: 14px;
          margin-top: 50px;
          margin-bottom: 46px;
        ">
        设置固定休息日
      </div>
      <el-checkbox-group v-model="checkList" @change="cliak"
        style="display: flex; justify-content: center; width: 100%">
        <el-checkbox :label="item.id" v-for="(item, index) in checkdata" :key="index">{{ item.name }}</el-checkbox>
      </el-checkbox-group>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="installsetdata">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="绑定物联门禁" :visible.sync="chageequipmentpopup" width="50%">
      <el-table :data="Bindingiotdata" style="width: 100%">
        <el-table-column prop="equipmentnumber" style="white-space: nowrap" width="300px"
          label="设备编号"></el-table-column>
        <el-table-column prop="equipmenttype" label="设备类型"></el-table-column>
        <el-table-column prop="equipmentname" label="设备名称"></el-table-column>
        <el-table-column prop="networking" label="联网">
          <template slot-scope="scope" style="display: flex; align-items: center">
            <img src="../../../assets/img/dui.png" v-if="scope.row.networking"
              style="width: 14px; height: 14px; margin-right: 6px" alt />
          </template>
        </el-table-column>
        <el-table-column prop="switch" label="开关">
          <template slot-scope="scope" style="display: flex; align-items: center">
            <el-button v-if="scope.row.switch == 1" type="primary" size="mini">开门</el-button>
          </template>
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button @click.native.prevent="bindstall(scope.$index, Bindingiotdata)" type="text">绑定</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
    <el-dialog title="到店指引图片" style="height: auto; margin-bottom: 20px" :visible.sync="lookpopup" width="50%">
      <div v-if="ruleForm.guide_image" style="text-align: center">
        <el-image style="width: 376px; height: auto" :src="ruleForm.guide_image" :fit="fit"></el-image>
      </div>
      <div v-else style="
          margin: 0 auto;
          width: 376px;
          height: 600px;
          background-color: #f7f7f7;
          color: #999;
          font-size: 30px;
          display: flex;
          align-items: center;
          justify-content: center;
        ">
        <div>暂无图片</div>
      </div>
    </el-dialog>
    <!-- <el-dialog :title="statetitle" append-to-body :visible.sync="coninstallpopup" width="50%">
      <el-form ref="thingsstate" :model="thingsstate" :rules="rules">
        <el-form-item label="文字说明" prop="textarea" label-width="100px">
          <el-input
            type="textarea"
            :autosize="{ minRows: 2, maxRows: 4}"
            placeholder="请输入"
            v-model="thingsstate.textarea"
          ></el-input>
        </el-form-item>
        <el-form-item style="text-align: right;">
          <el-button @click="coninstallpopup=false">取消</el-button>
          <el-button type="primary" @click="submitFormthingsstate('thingsstate')">保存</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>-->
    <el-dialog title="添加座位" :visible.sync="addseathDialog" width="50%">
      <el-form ref="addformInfo" :model="addformInfo" :rules="rules">
        <el-form-item label="座位数量：" prop="seatnum" label-width="200px">
          <el-input v-model="addformInfo.seatnum" placeholder="请输入座位数量" />
        </el-form-item>
        <el-form-item label="座位类型：" prop="seattype" label-width="200px">
          <el-select v-model="addformInfo.seattype" style="width: 100%" clearable placeholder="请选择座位类别">
            <el-option v-for="item in gen" :key="item.id" :label="item.title" :value="item.id" />
          </el-select>
        </el-form-item>
        <el-form-item style="text-align: right">
          <el-button @click="closeDialog()">取消</el-button>
          <el-button type="primary" @click="submitForm('addformInfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="编辑座位" :visible.sync="editseathDialog" width="50%">
      <el-form ref="editformInfo" :model="editformInfo" :rules="rules">
        <!-- <el-form-item label="座位数量：" prop="seatnum" label-width="200px">
          <el-input v-model="editformInfo.seatnum" placeholder="请输入座位数量" />
        </el-form-item>-->
        <el-form-item label="座位编号：" prop="seat_name" label-width="200px">
          <el-input v-model="editformInfo.seat_name" placeholder="请输入座位编号"></el-input>
        </el-form-item>
        <el-form-item style="text-align: right">
          <el-button @click="editseathDialog = false">取消</el-button>
          <el-button type="primary" @click="editsubmitForm('editformInfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="类别设置" :visible.sync="installDialog" width="50%">
      <el-table :data="installtableData" style="width: 100%">
        <el-table-column prop="title" label="类别名称"></el-table-column>
        <el-table-column prop="price" label="类别价格"></el-table-column>
        <!-- <el-table-column prop="reserve" label="提前预定"></el-table-column> -->
        <el-table-column prop="seat" label="预定天数"></el-table-column>
        <el-table-column prop="minute" label="预定最少分钟"></el-table-column>
        <el-table-column prop="vertex" label="封顶价格"></el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button @click.native.prevent="installed(scope.row)" type="text">设置</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
    <el-dialog title="类别设置" :visible.sync="installDialog2" width="50%">
      <el-form ref="typpinstall" :model="typpinstall" :rules="rules">
        <el-form-item label="类别" prop="title" label-width="200px">
          <el-input v-model="typpinstall.title" disabled></el-input>
        </el-form-item>
        <el-form-item label="预定价格" prop="price" label-width="200px">
          <el-input v-model="typpinstall.price">
            <template slot="append">元/小时</template>
          </el-input>
        </el-form-item>
        <!-- <el-form-item label="提前？天预定座位" prop="reserve" label-width="200px">
          <el-input v-model="typpinstall.reserve">
            <template slot="append">天</template>
          </el-input>
          <div style="color:#AFAFAF;font-size:14px">* 设为0，则为不限制</div>
        </el-form-item>-->
        <el-form-item label="可预订？天内的座位" prop="seat" label-width="200px">
          <el-input v-model="typpinstall.seat">
            <template slot="append">天</template>
          </el-input>
        </el-form-item>
        <el-form-item label="单次预定最少分钟数" prop="minute" label-width="200px">
          <el-input v-model="typpinstall.minute">
            <template slot="append">分钟</template>
          </el-input>
          <div style="color: #afafaf; font-size: 14px">* 设为0，则为不限制</div>
        </el-form-item>
        <el-form-item label="单次预定价格封顶" prop="vertex" label-width="200px">
          <el-input v-model="typpinstall.vertex">
            <template slot="append">元</template>
          </el-input>
          <div style="color: #afafaf; font-size: 14px">* 设为0，则为不限制</div>
        </el-form-item>
        <el-form-item label="类别说明" prop="desc" label-width="200px">
          <el-input type="textarea" placeholder="请输入内容" v-model="typpinstall.desc"></el-input>
        </el-form-item>
        <el-form-item style="text-align: right">
          <el-button @click="installDialog2 = fasle">取消</el-button>
          <el-button type="primary" @click="submitFormtyppinstall('typpinstall')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="添加房间" :visible.sync="addroompopup" width="50%">
      <el-form ref="addroominfo" :model="addroominfo" :rules="rules">
        <el-form-item label="房间名称" prop="roomname" label-width="200px">
          <el-input v-model="addroominfo.roomname"></el-input>
        </el-form-item>
        <el-form-item label="可坐人数" prop="seatingnum" label-width="200px">
          <el-input v-model="addroominfo.seatingnum"></el-input>
        </el-form-item>
        <el-form-item label="订房价格" prop="roomprice" label-width="200px">
          <el-input v-model="addroominfo.roomprice">
            <template slot="append">元/小时</template>
          </el-input>
        </el-form-item>
        <!-- <el-form-item label="提前？预定房间" prop="advanceroom" label-width="200px">
          <el-input v-model="addroominfo.advanceroom">
            <template slot="append">天</template>
          </el-input>
          <div style="color:#AFAFAF;font-size:14px;text-align:left;">* 设为0，则为不限制</div>
        </el-form-item> -->
        <el-form-item label="可预定？天内的房间" prop="canday" label-width="200px">
          <el-input v-model="addroominfo.canday" oninput="value=value.replace(/[^\d]/g,'')">
            <template slot="append">天</template>
          </el-input>
          <div style="color: #afafaf; font-size: 14px; text-align: left">
            * 预定天数不能小于1
          </div>
        </el-form-item>
        <el-form-item label="单次订房最少分钟数" prop="oneminute" label-width="200px">
          <el-input v-model="addroominfo.oneminute">
            <template slot="append">分钟</template>
          </el-input>
          <div style="color: #afafaf; font-size: 14px; text-align: left">
            * 设为0，则为不限制
          </div>
        </el-form-item>
        <!-- <el-form-item label="选择房间座位" prop="chooseroomseat" label-width="200px">
          <el-select v-model="addroominfo.chooseroomseat" multiple placeholder="请选择">
            <el-option
              v-for="item in roomseatoptions"
              :key="item.id"
              :label="item.title"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>-->
        <el-form-item style="text-align: right">
          <el-button @click="addroompopup = fasle">取消</el-button>
          <el-button type="primary" @click="submitFormaddroominfo('addroominfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="编辑房间" :visible.sync="editroompopup" width="50%">
      <el-form ref="editroominfo" :model="editroominfo" :rules="rules">
        <el-form-item label="房间名称" prop="room_name" label-width="200px">
          <el-input v-model="editroominfo.room_name"></el-input>
        </el-form-item>
        <el-form-item label="可坐人数" prop="num" label-width="200px">
          <el-input v-model="editroominfo.num"></el-input>
        </el-form-item>
        <el-form-item label="订房价格" prop="price" label-width="200px">
          <el-input v-model="editroominfo.price">
            <template slot="append">元/小时</template>
          </el-input>
        </el-form-item>
        <!-- <el-form-item label="提前？预定房间" prop="advance_time" label-width="200px">
          <el-input v-model="editroominfo.advance_time">
            <template slot="append">天</template>
          </el-input>
          <div style="color:#AFAFAF;font-size:14px;text-align:left;">* 设为0，则为不限制</div>
        </el-form-item> -->
        <el-form-item label="可预定？天内的房间" prop="set_time" label-width="200px">
          <el-input v-model="editroominfo.set_time" oninput="value=value.replace(/[^\d]/g,'')">
            <template slot="append">天</template>
          </el-input>
          <div style="color: #afafaf; font-size: 14px; text-align: left">
            * 预定天数不能小于1
          </div>
        </el-form-item>
        <el-form-item label="单次订房最少分钟数" prop="minutes" label-width="200px">
          <el-input v-model="editroominfo.minutes">
            <template slot="append">分钟</template>
          </el-input>
          <div style="color: #afafaf; font-size: 14px; text-align: left">
            * 设为0，则为不限制
          </div>
        </el-form-item>
        <!-- <el-form-item label="选择房间座位" prop="chooseroomseat" label-width="200px">
          <el-select v-model="editroominfo.chooseroomseat" multiple placeholder="请选择">
            <el-option
              v-for="item in roomseatoptions"
              :key="item.id"
              :label="item.title"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>-->
        <el-form-item style="text-align: right">
          <el-button @click="editroompopup = fasle">取消</el-button>
          <el-button type="primary" @click="submitFormeditroominfo('editroominfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="添加预约" :visible.sync="addappointmentpopup" width="50%">
      <el-form ref="addappointment" :model="addappointment" :rules="rules">
        <el-form-item label="预约日期" prop="stardate" label-width="200px">
          <el-col :span="6">
            <el-date-picker v-model="addappointment.stardate" value-format="yyyy-MM-dd" :picker-options="pickerOptions"
              type="date" placeholder="选择日期"></el-date-picker>
          </el-col>
        </el-form-item>
        <!-- <el-form-item label="预约结束日期" prop="enddate" label-width="200px">
          <el-col :span="6">
            <el-date-picker
              v-model="addappointment.enddate"
              value-format="yyyy-MM-dd"
              :picker-options="pickerOptions"
              type="date"
              placeholder="选择日期"
            ></el-date-picker>
          </el-col>
        </el-form-item> -->
        <el-form-item label="预约开始" prop="startime" label-width="200px">
          <el-col :span="6">
            <el-time-select v-model="addappointment.startime" :picker-options="{
                start: '00:00',
                step: '00:30',
                end: '24:00',
                maxTime: addappointment.endtime,
              }" placeholder="选择时间"></el-time-select>
          </el-col>
        </el-form-item>
        <el-form-item label="预约结束" prop="endtime" label-width="200px">
          <el-col :span="6">
            <el-time-select v-model="addappointment.endtime" :picker-options="{
                start: '00:00',
                step: '00:30',
                end: '24:00',
                minTime: addappointment.startime,
              }" placeholder="选择时间"></el-time-select>
          </el-col>
        </el-form-item>
        <el-form-item label="客户手机" prop="kehuphone" label-width="200px">
          <el-input v-model="addappointment.kehuphone" placeholder="请输入用户手机"></el-input>
        </el-form-item>
        <el-form-item style="text-align: right">
          <el-button @click="addappointmentpopup = false">取消</el-button>
          <el-button type="primary" @click="submitFormaddappointment('addappointment')">确定预约</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="添加货柜" :visible.sync="addcontainerDialog" width="50%">
      <el-form ref="addcontainerInfo" :model="addcontainerInfo" :rules="rules">
        <el-form-item label="货柜ID" prop="containerid" label-width="200px">
          <el-input v-model="addcontainerInfo.containerid" placeholder="请输入货柜ID" />
        </el-form-item>
        <el-form-item label="柜子数量" prop="containernum" label-width="200px">
          <el-input v-model="addcontainerInfo.containernum" placeholder="请输入柜子数量" />
        </el-form-item>
        <el-form-item style="text-align: right">
          <el-button @click="addcontainerDialog = false">取消</el-button>
          <el-button type="primary" @click="submitFormaddcontainerDialog('addcontainerInfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="货柜收费设置" :visible.sync="chargeDialog" width="50%">
      <el-form ref="chargedata" :model="chargedata" :rules="rules">
        <el-form-item label="免费使用时长" prop="freetime" label-width="200px">
          <el-input v-model="chargedata.freetime">
            <template slot="append">小时</template>
          </el-input>
        </el-form-item>
        <el-form-item label="超时后费用" prop="freedprice" label-width="200px">
          <el-input v-model="chargedata.freedprice">
            <template slot="append">元/小时</template>
          </el-input>
        </el-form-item>
        <!-- <el-form-item label="操作密码" prop="statepswd" label-width="200px">
          <el-input v-model="chargedata.statepswd"></el-input>
        </el-form-item>-->
        <el-form-item style="text-align: right">
          <el-button @click="chargeDialog = fasle">取消</el-button>
          <el-button type="primary" @click="submitFormchargedata('chargedata')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="门禁配置" :visible.sync="controlDialog" width="50%">
      <el-form ref="controldata" :model="controldata" :rules="rules">
        <el-form-item label="选择门禁" prop="choosecontrol" label-width="200px">
          <el-select v-model="controldata.choosecontrol" style="width: 100%" placeholder="选择可用门禁">
            <el-option v-for="item in choosecontroloptions" :key="item.id" :label="item.text"
              :value="item.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="门禁类型" prop="controltype" label-width="200px">
          <el-select v-model="controldata.controltype" style="width: 100%" placeholder="选择门禁类型">
            <el-option v-for="item in controlotypeptions" :key="item.id" :label="item.text"
              :value="item.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="门禁名称" prop="controlname" label-width="200px">
          <el-input v-model="controldata.controlname" placeholder="请输入门禁名称"></el-input>
        </el-form-item>
        <el-form-item style="text-align: right">
          <el-button @click="controlDialog = fasle">取消</el-button>
          <el-button type="primary" @click="submitFormcontroldata('controldata')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="占柜" :visible.sync="incabinetpopup" width="50%">
      <el-form ref="incabinetdata" :model="incabinetdata" :rules="rules">
        <el-form-item label="开始时间" prop="incabinettime" label-width="200px">
          <el-date-picker v-model="incabinetdata.incabinettime" value-format="timestamp" type="datetime"
            placeholder="选择开始时间"></el-date-picker>
        </el-form-item>
        <el-form-item label="结束时间" prop="incabinettimes" label-width="200px">
          <el-date-picker v-model="incabinetdata.incabinettimes" value-format="timestamp" type="datetime"
            placeholder="选择结束时间"></el-date-picker>
        </el-form-item>
        <el-form-item label="手机号" prop="users" label-width="200px">
          <el-input v-model="incabinetdata.users" placeholder="请输入手机号码"></el-input>
        </el-form-item>
        <!-- <el-form-item label="费用" prop="incabinetprice" label-width="200px">
          <el-input v-model="incabinetdata.incabinetprice">
            <template slot="append">元</template>
          </el-input>
        </el-form-item> -->
        <el-form-item style="text-align: right">
          <el-button @click="incabinetpopup = fasle">取消</el-button>
          <el-button type="primary" @click="submitFormincabinetdata('incabinetdata')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="相册图片" @close="handleClose" :visible.sync="imgtypeDialog" width="50%">
      <el-upload action="https://m.sapiki.com//admin/common/imageUpload" list-type="picture-card"
        :file-list="showimglist" :on-success="handimg" :before-upload="beforeAvatarUpload" :on-remove="handimgRemove">
        <i class="el-icon-plus"></i>
      </el-upload>
      <div style="text-align: right">
        <el-button @click="imgtypeDialog = false">取消</el-button>
        <el-button type="primary" @click="config">确定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="编辑" :visible.sync="editpop" width="50%">
      <el-form :model="edithao" class="demo-form-inline" label-width="100px">
        <el-form-item label="显示号" prop="">
          <el-input v-model="edithao.num" placeholder="请输入显示号"></el-input>
        </el-form-item>
        <el-form-item style="text-align: right">
          <el-button @click="editpop = false">取消</el-button>
          <el-button type="primary" @click="configpop()">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
  <div v-else class="titbox">
    <el-table :data="ruleForm" style="width: 100%">
      <el-table-column label="店名" prop="store_name" label-class-name="colname"></el-table-column>
      <el-table-column label="地址" prop="address" label-class-name="colname" show-overflow-tooltip></el-table-column>
      <el-table-column label="营业时间" prop="start_time" label-class-name="colname"></el-table-column>
      <el-table-column label="临时休息日" prop="temp_start_time" label-class-name="colname">
        <template slot-scope="scope">
          <span v-if="
              scope.row.temp_end_time == 0 || scope.row.temp_start_time == 0
            ">未设置</span>
          <span v-else>{{ scope.row.temp_start_time }}-{{ scope.row.temp_end_time }}</span>
        </template>
      </el-table-column>
      <el-table-column label="固定休息日" prop="rest_time" label-class-name="colname" show-overflow-tooltip>
        <template slot-scope="scope">
          <a size="mini" style="
              overflow: hidden;
              white-space: nowrap;
              text-overflow: ellipsis;
            " v-for="(item, index) in scope.row.rest_time.split(',')" :key="index">
            {{
            scope.row.rest_time.split(",").length == 1
            ? item == 1
            ? "星期一"
            : item == 2
            ? "星期二"
            : item == 3
            ? "星期三"
            : item == 4
            ? "星期四"
            : item == 5
            ? "星期五"
            : item == 6
            ? "星期六"
            : item === "0"
            ? "星期日"
            : item === ""
            ? "未设置"
            : ""
            : item == 1
            ? "星期一,"
            : item == 2
            ? "星期二,"
            : item == 3
            ? "星期三,"
            : item == 4
            ? "星期四,"
            : item == 5
            ? "星期五,"
            : item == 6
            ? "星期六,"
            : item === "0"
            ? "星期日,"
            : item === ""
            ? "未设置,"
            : ""
            }}
          </a>
        </template>
      </el-table-column>
      <el-table-column label="绑定" prop="udp_time" label-class-name="colname"></el-table-column>
      <el-table-column label="启用" prop="status" label-class-name="colname">
        <template slot-scope="scope">
          <!-- <img
            src="../../../assets/img/dui.png"
            v-if="scope.row.status==1"
            style="width:14px;height:14px;"
            alt
          />-->
          <!-- <img src="../../../assets/img/error.png" v-else style="width:14px;height:14px;" alt /> -->
          <el-switch v-model="scope.row.check" @change="handleLock(scope.row)" active-color="#409EFF"
            inactive-color="#DCDFE6"></el-switch>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="250">
        <template slot-scope="scope">
          <el-button type="text" @click="handleEdit(scope.row)">管理</el-button>
          <!-- <el-button type="text" v-if="scope.row.status==1" @click="handleLock(scope.row)">停用</el-button> -->
          <!-- <el-button type="text" v-else @click="handleLock(scope.row)">启用</el-button> -->
          <el-button type="text" @click="installdates(scope.row)">设置休息日</el-button>
          <el-button type="text" v-if="store_27" @click="installdel(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div style="width: 100%; text-align: center; margin: 50px auto">
      <el-pagination background :page-size="10" :page-sizes="[10, 20, 50, 100]"
        layout="total,prev, sizes, pager, next, jumper" @size-change="handleSizeChanges" :total="totles"
        @current-change="fenyeBtns"></el-pagination>
    </div>
    <!-- <el-dialog title="编辑客户" :visible.sync="dialogVisible" width="50%">
      <el-form
        ref="formInfo"
        :rules="rules"
        :model="formInfo"
        class="demo-form-inline"
        label-width="100px"
      >
        <el-form-item label="客户名称" prop="nickname">
          <el-input v-model="formInfo.nickname" />
        </el-form-item>
        <el-form-item label="客户手机" prop="phone">
          <el-input v-model.number="formInfo.phone" />
        </el-form-item>
        <el-form-item label="客户类别" prop="type">
          <el-select style="width:100%" v-model="formInfo.type" clearable placeholder="请选择客户类别">
            <el-option
              v-for="item in type"
              :key="item.userId"
              :label="item.value"
              :value="item.userId"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="客户性别" prop="sex">
          <el-select style="width:100%" v-model="formInfo.sex" clearable placeholder="请选择客户性别">
            <el-option
              v-for="item in sex"
              :key="item.userId"
              :label="item.value"
              :value="item.userId"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="生日" prop="birthday">
          <el-date-picker
            v-model="formInfo.birthday"
            align="right"
            type="date"
            placeholder="选择日期"
            :picker-options="pickerOptions"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="学习目标" prop="target_id">
          <el-select style="width:100%" v-model="formInfo.target_id" clearable placeholder="请选择">
            <el-option
              v-for="item in addData.target"
              :key="item.id"
              :label="item.title"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="学习内容" prop="content_id">
          <el-select style="width:100%" v-model="formInfo.content_id" clearable placeholder="请选择">
            <el-option
              v-for="item in addData.content"
              :key="item.id"
              :label="item.title"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="学习时长" prop="length_id">
          <el-select style="width:100%" v-model="formInfo.length_id" clearable placeholder="请选择">
            <el-option
              v-for="item in addData.duration"
              :key="item.id"
              :label="item.title"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="路程花费" prop="cost_id">
          <el-select style="width:100%" v-model="formInfo.cost_id" clearable placeholder="请选择">
            <el-option
              v-for="item in addData.cost"
              :key="item.id"
              :label="item.title"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="来源渠道" prop="channel_id">
          <el-select style="width:100%" v-model="formInfo.channel_id" clearable placeholder="请选择">
            <el-option
              v-for="item in addData.channel"
              :key="item.id"
              :label="item.title"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item style="text-align: right;">
          <el-button @click="closeDialog()">取消</el-button>
          <el-button type="primary" @click="submitForm('formInfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>-->
    <!-- <el-dialog title="设置休息日" :visible.sync="dialogVisible" width="50%">
      <el-switch
        v-model="value"
        active-color="#409EFF"
        inactive-color="#ff4949"
        @change="swichange"
      ></el-switch>
      <span style="margin-left:14px;color:#333333;font-size:14px;">点击开启临时休息日</span>
      <div v-if="bool==true" style="margin-top:30px;margin-left:90px;">
        <span style="color:#333333;font-size:14px;margin-right:16px">设置临时休息日</span>
        <el-date-picker
          v-model="value1"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </div>
      <div
        style="text-align:center;color:#333333;font-size:14px;margin-top:50px;margin-bottom:46px;"
      >设置固定休息日</div>
      <el-checkbox-group v-model="checkList" style="display:flex;justify-content: center;">
        <el-checkbox :label="item.text" v-for="(item,index) in checkdata" :key="index"></el-checkbox>
      </el-checkbox-group>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>-->
  </div>
</template>
<script
  charset="utf-8"
  src="https://map.qq.com/api/js?v=2.exp&key=M6DBZ-QDQKU-OV3VS-2HEJJ-UMTXZ-NTBY3"
></script>
<script>
// var moment = require("moment");
// var searchService,
//   geocoder,
//   map,
//   markersArray = [];
import { mapGetters } from "vuex";
import { quillEditor } from "vue-quill-editor";
import draggable from "vuedraggable";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import {
  storeList,
  returnStore,
  storeEdit,
  storeSeniorReturn,
  storeSeniorSeatL,
  storeSeniorRoomL,
  storeSeniorContainerL,
  storeDoorL,
  storeDoorD,
  lists,
  storeSeniorSeatA,
  storeSeniorGenreL,
  storeSeniorRoomA,
  storeSeniorContainerA,
  storeSeniorContainerE,
  storeSeniorRoomD,
  storeGenreType,
  storeSeniorRoomM,
  storeSeniorDoorL,
  storeSeniorDoorOpen,
  storeSeniorEdit,
  storeSeniorGenreE,
  storeSeniorSeatD,
  storeSeniorSeatP,
  storeSeniorSeatC,
  status,
  storeDel,
  storeSeniorContainerP,
  storeSeniorContainerD,
  storeSeatNameEdit,
  album,
  albumEdit,
  storeSeniorContainerOpen,
  storeSeniorContainerRefresh,
  storeSeniorContainerZhan,
  cancelstoreSeniorContainerZhan,
  storeSeniorContainerEdit,
} from "@/api/user";
import Base64 from "@/utils/base";
import { getp_id } from "@/utils/getmenuid";
import Vue from "vue";
import { VueJsonp } from "vue-jsonp";
Vue.use(VueJsonp);
const vm = new Vue();
export default {
  name: "Dashboard",
  computed: {
    ...mapGetters(["name"]),
  },
  components: {
    Map,
    quillEditor,
  },
  inject: ["reload"],
  data() {
    return {
      // startTime:"",
      // endTime:"",
      uploadDisabled: false,
      uploadDisabled1: false,
      uploadDisabled2: false,
      store_1: false,
      store_2: false,
      store_3: false,
      store_4: false,
      store_5: false,
      store_6: false,
      store_7: false,
      store_8: false,
      store_9: false,
      store_10: false,
      store_11: false,
      store_12: false,
      store_13: false,
      store_14: false,
      store_15: false,
      store_16: false,
      store_17: false,
      store_18: false,
      store_19: false,
      store_20: false,
      store_22: false,
      store_26: false,
      store_27: false,
      // store_28: false,
      store_29: false,
      store_30: false,
      store_21: false,
      store_23: false,
      store_32: false,
      store_24: false,
      store_25: false,
      store_33: false,
      imgtypeDialog: false,
      srcList: [],
      room_id: "",
      img_id: "",
      fileLists: [],
      imageUrlarr: "",
      imageUrlsarr: "",
      imageUrlatvarr: "",
      location_imgfile: [],
      avcReturndata: "",
      cabinetnumber: "",
      fit: ["fill"],
      statetitle: "",
      coninstallpopup: false,
      lookpopup: false,
      chageequipmentpopup: false,
      addroompopup: false,
      editroompopup: false,
      addappointmentpopup: false,
      incabinetpopup: false,
      chargeDialog: false,
      controlDialog: false,
      editroomid: "",
      chargedata: {},
      incabinetdata: {},
      addroominfo: {},
      editroominfo: "",
      addappointment: {},
      addcontainerInfo: {},
      seat_id: "",
      zhanid: "",
      settingDialogtableData: [
        {
          containerid: 2,
          pswd: "888888",
        },
      ],
      typpinstall: "",
      installtableData: "",
      roomtableData: "",
      containertableData: "",
      accessableData: "",
      Bindingiotdata: [
        {
          equipmentnumber: "60FE76ACD83BA9057C4C030B",
          equipmenttype: "门禁控件",
          equipmentname: "—",
          networking: true,
          switch: 1,
        },
      ],
      addseathDialog: false,
      editseathDialog: false,
      addcontainerDialog: false,
      installDialog: false,
      // settingDialog: false,
      installDialog2: false,
      addformInfo: {},
      editformInfo: {
        seat_name: "",
      },
      thingsstate: {
        textarea: "",
      },
      controldata: {},
      seattableData: "",
      content: "",
      editorOption: {},
      dialogImageUrl: "",
      dialogVisiblepath: false,
      dialogImageUrls: "",
      dialogVisiblepaths: false,
      dialogVisiblepath1: false,
      dialogVisiblepath2: false,
      value1: [],
      bool: "",
      storeimageUrl: "",
      rest_time: "",
      checkList: [],
      totle: 10,
      totles: 10,
      pages: 1,
      num: 10,
      nums: 10,
      page2: 1,
      totle2: 10,
      num2: 10,
      page3: 1,
      totle3: 10,
      num3: 10,
      page4: 1,
      totle4: 10,
      num4: 10,
      showimglist: [],
      checkdata: [
        {
          id: "1",
          name: "星期一",
        },
        {
          id: "2",
          name: "星期二",
        },
        {
          id: "3",
          name: "星期三",
        },
        {
          id: "4",
          name: "星期四",
        },
        {
          id: "5",
          name: "星期五",
        },
        {
          id: "6",
          name: "星期六",
        },
        {
          id: "0",
          name: "星期日",
        },
      ],
      value: false,
      dialogVisible: false,
      latitude: "",
      longitude: "",
      url: "",
      options: "",
      options1: "",
      group: {
        name: "itxst", //组名为itxst
        pull: true, //是否允许拖入当前组
        put: true, //是否允许拖出当前组
      },
      roomseatoptions: "",
      choosecontroloptions: [
        {
          id: 1,
          text: "1-1",
        },
        {
          id: 2,
          text: "1-4",
        },
        {
          id: 3,
          text: "2-3",
        },
        {
          id: 4,
          text: "3-1",
        },
        {
          id: 5,
          text: "5-2",
        },
      ],
      controlotypeptions: [
        {
          id: 1,
          text: "1-1",
        },
        {
          id: 2,
          text: "1-4",
        },
        {
          id: 3,
          text: "2-3",
        },
        {
          id: 4,
          text: "3-1",
        },
        {
          id: 5,
          text: "5-2",
        },
      ],
      startTime1: [],
      ruleForm: "",
      isdel: false,
      page: 1,
      pickerOptions: {
        disabledDate(date) {
          return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
        },
      },
      drag: false,
      //定义要被拖拽对象的数组
      myArray: [
        { id: 10, name: "www.itxst.com" },
        { id: 20, name: "www.baidu.com" },
        { id: 30, name: "www.taobao.com" },
        { id: 40, name: "www.yahoo.com" },
      ],
      rules: {
        textarea: [
          { required: true, message: "请输入文字说明", trigger: "change" },
        ],
        choosecontrol: [
          { required: true, message: "请选择可用门禁", trigger: "change" },
        ],
        controltype: [
          { required: true, message: "请选择门禁类型", trigger: "change" },
        ],
        controlname: [
          { required: true, message: "请输入门禁名称", trigger: "change" },
        ],
        freetime: [
          { required: true, message: "请输入免费使用时长", trigger: "change" },
        ],
        freedprice: [
          { required: true, message: "请输入超时收费标准", trigger: "change" },
        ],
        incabinettime: [
          { required: true, message: "请选择开始时间", trigger: "change" },
        ],
        incabinettimes: [
          { required: true, message: "请选择结束时间", trigger: "change" },
        ],
        users: [
          { required: true, message: "请输入手机号码", trigger: "change" },
        ],
        // incabinetprice: [
        //   { required: true, message: "请输入费用", trigger: "change" }
        // ],
        // statepswd: [
        //   { required: true, message: "请输入操作密码", trigger: "change" }
        // ],
        containerid: [
          { required: true, message: "请输入货柜ID", trigger: "change" },
        ],
        containernum: [
          { required: true, message: "请输入柜子数量", trigger: "change" },
        ],
        stardate: [
          { required: true, message: "请选择预约开始日期", trigger: "change" },
        ],
        enddate: [
          { required: true, message: "请选择营业时间", trigger: "change" },
        ],
        // startTime1:[
        // { required: true, message: "请选择预约结束日期", trigger: "change" }
        // ],
        startime: [
          { required: true, message: "请选择预约开始时间", trigger: "change" },
        ],
        endtime: [
          { required: true, message: "请选择预约开始时间", trigger: "change" },
        ],
        kehuphone: [
          { required: true, message: "请输入用户手机", trigger: "change" },
        ],
        roomname: [
          { required: true, message: "请输入房间名称", trigger: "change" },
        ],
        seatingnum: [
          { required: true, message: "请输入可坐人数", trigger: "change" },
        ],
        roomprice: [
          { required: true, message: "请输入订房价格", trigger: "change" },
        ],
        // advanceroom: [
        //   { required: true, message: "提前？预定房间", trigger: "change" }
        // ],
        canday: [
          { required: true, message: "可预定？天内的房间", trigger: "change" },
        ],
        oneminute: [
          {
            required: true,
            message: "请输入单次订房最少分钟数",
            trigger: "change",
          },
        ],
        // chooseroomseat: [
        //   { required: true, message: "请选择房间座位", trigger: "blur" }
        // ],
        scheduledprice: [
          { required: true, message: "请输入预定价格", trigger: "change" },
        ],
        scheduledseat: [
          { required: true, message: "提前？天预定座位", trigger: "change" },
        ],
        seat: [
          { required: true, message: "可预订？天内的座位", trigger: "change" },
        ],
        minute: [
          { required: true, message: "单次预定最少分钟数", trigger: "blur" },
        ],
        cap: [
          { required: true, message: "单次预定价格封顶", trigger: "change" },
        ],
        category: [
          { required: true, message: "请输入类别", trigger: "change" },
        ],
        seatnum: [
          { required: true, message: "请输入座位数量", trigger: "change" },
        ],
        seattype: [
          { required: true, message: "请输入座位类型", trigger: "change" },
        ],
        // address: [
        //   { required: true, message: "请输入门店地址", trigger: "blur" }
        // ],
        name: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        start_time: [
          { required: true, message: "请输入开始时间", trigger: "change" },
        ],
        end_time: [
          { required: true, message: "请输入结束时间", trigger: "change" },
        ],
        // seattype: [
        //   { required: true, message: "请选择座位类别", trigger: "change" }
        // ],
        date1: [
          {
            type: "date",
            required: true,
            message: "请选择日期",
            trigger: "blur",
          },
        ],
        date2: [
          {
            type: "date",
            required: true,
            message: "请选择时间",
            trigger: "blur",
          },
        ],
      },
      bools: "",
      activeName: "store_1",
      itemdata: [
        {
          id: "",
          text: "",
        },
        {
          id: "",
          text: "",
        },
        {
          id: "",
          text: "",
        },
        {
          id: "",
          text: "",
        },
        {
          id: "",
          text: "",
        },
        {
          id: "",
          text: "",
        },
      ],
      p_id: "",
      fac: "",
      gen: "",
      imageUrl: "",
      imageUrls: "",
      imageUrlatv: "",
      coordinate: {
        lat: "",
        lng: "",
      },
      editpop: false,
      container_id: "", //货柜id
      edithao: {
        num: "",
      },
    };
  },
  mounted() {
    this.bools =
      JSON.parse(localStorage.getItem("storemenu"))[0].id == "" ? false : true;
    this.getip();
    this.init();
    this.getlists();
    this.getstoreList(
      JSON.parse(localStorage.getItem("storemenu"))[0].id,
      1,
      10
    );
    setTimeout(() => {
      this.getcheckdata();
    }, 500);
  },
  // created() {
  // setTimeout(() => {
  //     this.$refs.myquill.$refs.myQuillEditor.quill.enable(true)
  // }, 0)
  // this.p_id = getp_id()
  // if(this.p_id){
  // console.log(this.p_id)

  // }
  // },
  components: {
    draggable,
    quillEditor,
  },
  computed: {
    activeItemList() {
      return this.itemdata.filter((item) => {
        return item.id != "";
      });
    },
  },
  methods: {
    changetabs(e) {
      this.startTime1 = [e[0], e[1]];
    },
    //开始拖拽事件
    onStart() {
      this.drag = true;
    },
    //拖拽结束事件
    onEnd() {
      this.drag = false;
    },
    onChoose() {},
    switchbox(e) {},
    // 根据IP获取坐标
    getip() {
      setTimeout(() => {
        this.init();
        setTimeout(() => {
          this.getaddressinfo(this.coordinate.lat, this.coordinate.lng);
        }, 500);
        // this.ruleForm.address = res.result.ad_info.province+res.result.ad_info.city+res.result.ad_info.district
      }, 500);
      // this.$jsonp("https://apis.map.qq.com/ws/location/v1/ip", {
      //   key: "M6DBZ-QDQKU-OV3VS-2HEJJ-UMTXZ-NTBY3",
      //   output: "jsonp"
      // })
      //   .then(res => {
      //     console.log(res, "Res");
      //     if (res.status === 0) {
      //       // 获取到的经纬度处理
      //       this.coordinate.lat = parseFloat(res.result.location.lat).toFixed(
      //         6
      //       );
      //       this.coordinate.lng = parseFloat(res.result.location.lng).toFixed(
      //         6
      //       );
      //       // 获取到IP经纬度，在渲染地图（一种做法）
      //       this.init();
      //       setTimeout(() => {
      //         // this.ruleForm.address = res.result.ad_info.province+res.result.ad_info.city+res.result.ad_info.district
      //         this.getaddressinfo(
      //           parseFloat(res.result.location.lat).toFixed(6),
      //           parseFloat(res.result.location.lng).toFixed(6)
      //         );
      //       }, 500);
      //     }
      //   })
      //   .catch(e => {
      //     console.log(e);
      //   });
    },
    init() {
      //步骤：定义map变量 调用 qq.maps.Map() 构造函数   获取地图显示容器
      //设置地图中心点
      var myLatlng = new qq.maps.LatLng(
        this.coordinate.lat,
        this.coordinate.lng
      );
      //定义工厂模式函数
      var myOptions = {
        zoom: 13, //设置地图缩放级别
        center: myLatlng, //设置中心点样式
        mapTypeId: qq.maps.MapTypeId.ROADMAP, //设置地图样式详情参见MapType
      };
      //获取dom元素添加地图信息
      var map = new qq.maps.Map(
        document.getElementById("container"),
        myOptions
      );
      //给地图添加点击事件
      //并获取鼠标点击的经纬度
      let that = this;
      let marker = "";
      marker = new qq.maps.Marker({
        position: myLatlng,
        map: map,
      });
      qq.maps.event.addListener(map, "click", function (event) {
        if (!marker) {
          marker = new qq.maps.Marker({
            position: event.latLng,
            map: map,
          });
          return;
        }
        marker.setPosition(event.latLng);
        that.coordinate.lat = event.latLng.getLat();
        that.coordinate.lng = event.latLng.getLng();
        // that.getaddressinfo(event.latLng.getLat(), event.latLng.getLng());
      });
    },
    //获取详细地址
    getaddressinfo(lat, lng) {
      this.$jsonp("https://apis.map.qq.com/ws/geocoder/v1/?", {
        location: `${lat},${lng}`, // 经纬度
        key: "M6DBZ-QDQKU-OV3VS-2HEJJ-UMTXZ-NTBY3",
        output: "jsonp", // output必须jsonp   不然会超时
      }).then((res) => {
        // console.log(res,"22333")
        // this.ruleForm.address = res.result.formatted_addresses.recommend;
        // this.areaCode = res.result.ad_info.adcode;
      });
    },
    getlists() {
      lists(
        { request_data: Base64.encode(JSON.stringify({ pid: getp_id() })) }
        // { showLoading: true }
      ).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        let btnarr = [];
        res.result.map((v) => {
          btnarr.push(v.class_mark);
        });
        btnarr.forEach((item) => {
          if (item == "store_1") {
            this.store_1 = true;
            this.itemdata[0].id = "store_1";
            this.itemdata[0].text = "基本信息";
          }
          if (item == "store_0") {
            this.store_2 = true;
          }
          if (item == "store_3") {
            this.store_3 = true;
          }
          if (item == "store_4") {
            this.store_4 = true;
          }
          if (item == "store_5") {
            this.store_5 = true;
            this.itemdata[1].id = "store_5";
            this.itemdata[1].text = "高级设置";
          }
          if (item == "store_6") {
            this.store_6 = true;
          }
          if (item == "store_7") {
            this.store_7 = true;
          }
          if (item == "store_8") {
            this.store_8 = true;
          }
          if (item == "store_9") {
            this.store_9 = true;
          }
          if (item == "store_10") {
            this.store_10 = true;
          }
          if (item == "store_11") {
            this.store_11 = true;
          }
          if (item == "store_12") {
            this.store_12 = true;
            this.itemdata[2].id = "store_12";
            this.itemdata[2].text = "座位管理";
          }
          if (item == "store_13") {
            this.store_13 = true;
          }
          if (item == "store_14") {
            this.store_14 = true;
          }
          if (item == "store_16") {
            this.store_16 = true;
            this.itemdata[3].id = "store_16";
            this.itemdata[3].text = "会议室管理";
          }
          if (item == "store_17") {
            this.store_17 = true;
          }
          if (item == "store_18") {
            this.store_18 = true;
          }
          if (item == "store_19") {
            this.store_19 = true;
          }
          if (item == "store_20") {
            this.store_20 = true;
            this.itemdata[4].id = "store_20";
            this.itemdata[4].text = "货柜管理";
          }
          if (item == "store_21") {
            this.store_21 = true;
          }
          if (item == "store_22") {
            this.store_22 = true;
          }
          if (item == "store_23") {
            this.store_23 = true;
          }
          if (item == "store_32") {
            this.store_32 = true;
          }
          if (item == "store_24") {
            this.store_24 = true;
          }
          if (item == "store_33") {
            this.store_33 = true;
          }
          // if (item == "store_25") {
          //   this.store_25 = true;
          //   this.itemdata[5].id="store_25"
          //   this.itemdata[5].text="门禁管理"
          // }
          if (item == "store_26") {
            this.store_26 = true;
          }
          if (item == "store_27") {
            this.store_27 = true;
          }
          // if (item == "store_28") {
          //   this.store_28 = true;
          // }
          if (item == "store_29") {
            this.store_29 = true;
          }
          if (item == "store_30") {
            this.store_30 = true;
          }
        });
      });
    },
    getstoreList(id, page, num) {
      storeList({
        request_data: Base64.encode(
          JSON.stringify({
            page: page || this.pages,
            limit: num || this.nums,
            store_id: id,
            p_id: getp_id(),
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.itemdata[0].id = "store_1";
        this.totles = res.result.count;
        this.ruleForm = res.result.data;
        this.fac = res.result.data.facility_id;
        this.gen = res.result.data.type;
        let facid = [];
        let genid = [];
        this.fac.map((i) => {
          facid.push(i.id);
        });
        this.gen.map((i) => {
          genid.push(i.id);
        });
        this.facid = facid;
        this.genid = genid;
        this.ruleForm.type = genid;
        this.ruleForm.facility_id = facid;
        this.coordinate.lat = res.result.data.lat;
        this.coordinate.lng = res.result.data.lng;
        this.startTime1 = [
          res.result.data.start_time,
          res.result.data.end_time,
        ];
      });
    },
    installsetdata() {
      this.checkList = this.checkList.filter(function (s) {
        return s && s.trim();
      });
      this.rest_time = this.checkList.join(",");
      this.dialogVisible = false;
      this.$message({
        message: "设置成功",
        type: "success",
      });
    },
    cliak(e) {},
    //下拉数据
    getcheckdata() {
      returnStore({}).then((res) => {
        this.options1 = res.result.fac;
        this.options = res.result.gen;
      });
    },
    //高级设置
    getstoreSeniorReturn() {
      this.fileLists.length = 0;
      storeSeniorReturn({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.avcReturndata = res.result;
        this.imageUrl = res.result.location_img;
        if (res.result.location_img != "" || res.result.location_img != null) {
          this.uploadDisabled = true;
        }
        if (res.result.study_img != "" || res.result.study_img != null) {
          this.uploadDisabled1 = true;
        }
        if (
          res.result.store_activity != "" ||
          res.result.store_activity != null
        ) {
          this.uploadDisabled2 = true;
        }
        if (res.result.store_activity == null) {
          this.uploadDisabled2 = false;
        }
        if (res.result.study_img == null) {
          this.uploadDisabled1 = false;
        }
        if (res.result.location_img == null) {
          this.uploadDisabled = false;
        }
        this.imageUrlarr = res.result.location_img
          ? [
              {
                url: res.result.location_img,
              },
            ]
          : "";
        this.imageUrls = res.result.study_img;
        this.imageUrlsarr = res.result.study_img
          ? [
              {
                url: res.result.study_img,
              },
            ]
          : "";
        this.imageUrlatv = res.result.store_activity;
        this.imageUrlatvarr = res.result.store_activity
          ? [
              {
                url: res.result.store_activity,
              },
            ]
          : "";
        let objimg = JSON.parse(JSON.stringify(res.result.store_img));
        objimg.forEach((item) => {
          let obj = {
            url: item,
          };
          this.fileLists.push(obj);
        });
        this.$nextTick(() => {
          document.documentElement.scrollTop = 0;
        });
      });
    },
    handleSizeChange(val) {
      this.num = val;
      this.getsellsetdata(this.page, this.num);
    },
    fenyeBtn(e) {
      this.page = e;
      this.getsellsetdata(this.page, this.num);
    },
    handleSizeChange2(val) {
      this.num2 = val;
      this.getsellroomlist(this.page2, this.num2);
    },
    fenyeBtn2(e) {
      this.page2 = e;
      this.getsellroomlist(this.page2, this.num2);
    },
    handleSizeChange3(val) {
      this.num3 = val;
      this.getsellBox(this.page3, this.num3);
    },
    fenyeBtn3(e) {
      this.page3 = e;
      this.getsellBox(this.page3, this.num3);
    },
    handleSizeChange4(val) {
      this.num4 = val;
      this.getselldoor(this.page4, this.num4);
    },
    fenyeBtn4(e) {
      this.page4 = e;
      this.getselldoor(this.page4, this.num4);
    },
    handleSizeChanges(val) {
      this.nums = val;
      this.getstoreList(
        JSON.parse(localStorage.getItem("storemenu"))[0].id,
        this.pages,
        this.nums
      );
    },
    fenyeBtns(e) {
      this.pages = e;
      this.getstoreList(
        JSON.parse(localStorage.getItem("storemenu"))[0].id,
        this.pages,
        this.nums
      );
    },
    delimg(url) {
      const filePath = url;
      // console.log(filePath)
      // console.log(this.allpath)
      // return
      // 2.从pictureList数组中，找到图片对应的索引值
      const i = this.fileLists.findIndex((x) => x.url == filePath);
      // 3.调用splice方法，移除图片信息
      this.fileLists.splice(i, 1);
      this.$message({
        message: "移除成功",
        type: "success",
      });
    },
    //座位列表
    getsellsetdata(page, num) {
      storeSeniorSeatL({
        request_data: Base64.encode(
          JSON.stringify({
            page: page || this.page,
            limit: num || this.num,
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
            p_id: getp_id(),
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.seattableData = res.result.data;
        this.totle = res.result.count;
      });
    },
    //取消/绑定
    confirmcancel(val) {
      storeSeniorSeatC({
        request_data: Base64.encode(
          JSON.stringify({
            id: val.id,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.getsellsetdata();
      });
    },
    //座位启用停用
    operation(val) {
      storeSeniorSeatP({
        request_data: Base64.encode(
          JSON.stringify({
            id: val.id,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.getsellsetdata();
      });
    },
    //删除座位
    deleted(val) {
      this.$confirm("确定删除此条数据吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          storeSeniorSeatD({
            request_data: Base64.encode(
              JSON.stringify({
                id: val.id,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.getsellsetdata();
            this.$message({
              type: "success",
              message: "删除成功!",
            });
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    // 编辑座位
    editseat(val) {
      this.seat_id = val.id;
      this.editformInfo.seat_name = val.seat_name;
      this.editseathDialog = true;
    },
    //房间管理
    getsellroomlist(page, num) {
      storeSeniorRoomL({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
            p_id: getp_id(),
            page: page || this.page2,
            limit: num || this.num2,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.roomtableData = res.result.data;
        this.totle2 = res.result.count;
      });
    },
    //货柜管理
    getsellBox(page, num) {
      storeSeniorContainerL({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
            page: page || this.page3,
            limit: num || this.num3,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.containertableData = res.result.data;
        this.totle3 = res.result.count;
      });
    },
    //门禁管理
    getselldoor(page, num) {
      storeDoorL({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
            page: page || this.page4,
            limit: num || this.num4,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.accessableData = res.result.data;
        this.totle4 = res.result.count;
      });
    },
    handleClick(tab, event) {
      switch (tab.index) {
        case "0":
          this.getstoreList(
            JSON.parse(localStorage.getItem("storemenu"))[0].id,
            1,
            10
          );
          break;
        case "1":
          this.getstoreSeniorReturn();
          break;
        case "2":
          this.getsellsetdata();
          setTimeout(() => {
            this.getlists();
          }, 500);
          break;
        case "3":
          this.getsellroomlist();
          setTimeout(() => {
            this.getlists();
          }, 500);
          break;
        case "4":
          this.getsellBox();
          setTimeout(() => {
            this.getlists();
          }, 500);
          break;
        case "5":
          this.getselldoor();
          setTimeout(() => {
            this.getlists();
          }, 500);
          break;
      }
    },
    //占柜
    incabinet(val) {
      this.zhanid = val.id;
      this.incabinetpopup = true;
    },
    //取消占柜
    cancelincabinet(val) {
      cancelstoreSeniorContainerZhan({
        request_data: Base64.encode(
          JSON.stringify({
            user_set_container_id: val.user_set_container_id,
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
            // phone:this.incabinetdata.users
            // money:this.incabinetdata.incabinetprice,
            // start_time:this.incabinetdata.incabinettime/1000,
            // end_time:this.incabinetdata.incabinettimes/1000
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.getsellBox();
      });
    },
    //编辑
    editgui(val) {
      this.container_id = val.id;
      this.edithao.num = val.show_number;
      this.editpop = true;
    },
    configpop() {
      storeSeniorContainerEdit({
        request_data: Base64.encode(
          JSON.stringify({
            container_id: this.container_id,
            show_number: this.edithao.num,
            // store_id:JSON.parse(localStorage.getItem("storemenu"))[0].id,
            // phone:this.incabinetdata.users,
            // money:this.incabinetdata.incabinetprice,
            // start_time:this.incabinetdata.incabinettime/1000,
            // end_time:this.incabinetdata.incabinettimes/1000
          })
        ),
      }).then((res) => {
        if (res.status != 1) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.editpop = false;
        this.$message({
          message: res.message,
          type: "success",
        });
        this.getsellBox();
      });
    },
    //停用启用
    stopuse(val) {
      storeSeniorContainerP({
        request_data: Base64.encode(
          JSON.stringify({
            id: val.id,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.getsellBox();
      });
    },
    //开柜
    opengui(val) {
      storeSeniorContainerOpen({
        request_data: Base64.encode(
          JSON.stringify({
            container_id: val.id,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.getsellBox();
      });
    },
    delcabinet(val) {
      this.$confirm("确定删除此条数据吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          storeSeniorContainerD({
            request_data: Base64.encode(
              JSON.stringify({
                id: val.id,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.getsellBox();
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    opendoor() {},
    handleEdit(val) {
      this.getstoreList(val.id, 1, 10);
      localStorage.setItem(
        "storemenu",
        JSON.stringify([
          {
            id: val.id,
            store_name: val.store_name,
          },
        ])
      );
      this.reload();
      // localStorage.getItem("storemenu"))[0].id
      setTimeout(() => {
        this.getcheckdata();
        this.bools = true;
      }, 500);
    },
    deldoor(val) {
      let that = this;
      storeDoorD({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
            id: val.id,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          that.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        that.getselldoor();
      });
    },
    installdate() {
      this.dialogVisible = true;
      if (
        this.ruleForm.temp_end_time != 0 ||
        this.ruleForm.temp_start_time != 0
      ) {
        this.bool = true;
        this.value = true;
        this.value1[0] = this.ruleForm.temp_start_time;
        this.value1[1] = this.ruleForm.temp_end_time;
      }
      this.checkList = this.ruleForm.rest_time.split(",");
    },
    handleLock(val) {
      status({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: val.id,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.getstoreList(
          JSON.parse(localStorage.getItem("storemenu"))[0].id,
          1,
          10
        );
      });
    },
    installdates(val) {
      this.getstoreList(val.id, 1, 10);
      localStorage.setItem(
        "storemenu",
        JSON.stringify([
          {
            id: val.id,
            store_name: val.store_name,
          },
        ])
      );
      this.reload();
      // localStorage.getItem("storemenu"))[0].id
      setTimeout(() => {
        this.getcheckdata();
        this.bools = true;
      }, 500);
    },
    //门店删除
    installdel(val) {
      this.$confirm("确定删除此条数据吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          let parem = {
            store_id: val.id,
            pid: 144,
          };
          storeDel({
            request_data: Base64.encode(JSON.stringify(parem)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.$message({
              type: "success",
              message: "删除成功!",
            });
            this.getstoreList(
              JSON.parse(localStorage.getItem("storemenu"))[0].id,
              1,
              10
            );
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    swichange(e) {
      this.bool = e;
    },
    changecont(val) {
      this.avcReturndata.facility.map((v) => {
        if (val.id == v.id) {
          v.content = val.content;
        }
      });
    },
    handleRemove(file) {
      let filePath = file.url;
      let i = this.fileLists.findIndex((x) => x.url == filePath);
      this.fileLists.splice(i, 1);
    },
    //位置分布图
    handleRemoveposi(file) {
      // console.log(file)
      let filePath = file.url;
      let i = this.imageUrlarr.findIndex((x) => x.url == filePath);
      this.imageUrlarr.splice(i, 1);
      this.imageUrl = this.imageUrlarr;
      this.uploadDisabled = false;
    },
    handleRemovestudy(file) {
      let filePath = file.url;
      let i = this.imageUrlsarr.findIndex((x) => x.url == filePath);
      this.imageUrlsarr.splice(i, 1);
      this.imageUrls = this.imageUrlsarr;
      this.uploadDisabled1 = false;
    },
    handleRemovehis(file) {
      let filePath = file.url;
      let i = this.imageUrlatvarr.findIndex((x) => x.url == filePath);
      this.imageUrlatvarr.splice(i, 1);
      this.imageUrlatv = this.imageUrlatvarr;
      this.uploadDisabled2 = false;
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisiblepath = true;
    },
    handcardsuccess(res) {
      this.fileLists.push({
        url: res.file_path,
      });
    },
    handlestore(res) {
      this.storeimageUrl = res.file_path;
    },
    handleAvatarSuccess(res) {
      this.imageUrl = res.file_path;
    },
    handlequnAvatarSuccess(res, file) {
      this.imageUrls = res.file_path;
    },
    handleatvAvatarSuccess(res, file) {
      this.imageUrlatv = res.file_path;
    },
    beforeAvatarUpload(file) {
      const isJPG = file.type === "image/jpeg" || file.type == "image/png";
      const isLt2M = file.size / 1024 / 1024 < 2;
      if (!isJPG) {
        this.$message.error("上传头像图片只能是 JPG 或 PNG 格式!");
        return;
      }
      if (!isLt2M) {
        this.$message.error("上传头像图片大小不能超过 2MB!");
        return;
      }
    },
    handlePictureCardPreviews(file) {
      this.dialogImageUrls = file.url;
      this.dialogVisiblepaths = true;
    },
    handleChange(file, fileList) {
      if (fileList.length >= 1) {
        this.uploadDisabled = true;
      }
    },
    handleChange1(file, fileList) {
      if (fileList.length >= 1) {
        this.uploadDisabled1 = true;
      }
    },
    handleChange2(file, fileList) {
      if (fileList.length >= 1) {
        this.uploadDisabled2 = true;
      }
    },
    handlePictureCardPrestudy() {
      // this.dialogImageUrls = file.url;
      this.dialogVisiblepath1 = true;
    },
    handlePictureCardPrehis() {
      this.dialogVisiblepath2 = true;
    },
    submit() {},
    addseat() {
      this.addseathDialog = true;
    },
    typeinstall() {
      let that = this;
      storeSeniorGenreL({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        that.installtableData = res.result;
        that.installDialog = true;
      });
    },
    //开门
    openthedoor() {
      storeSeniorDoorOpen({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.$message({
          message: res.message,
          type: "success",
        });
        // this.chageequipmentpopup = true;
      });
    },
    openDoor1(mac) {
      this.$confirm("确定要开启此门禁吗？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          storeSeniorDoorOpen({
            request_data: Base64.encode(
              JSON.stringify({
                mac: mac,
              })
            ),
          }).then((res) => {
            if (res.status == 1) {
              this.$message({
                type: "success",
                message: "开门指令已发送!",
              });
            } else {
              this.$message({
                type: "warning",
                message: res.message || "开门失败",
              });
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    //换绑设备
    chageequipment() {
      storeSeniorDoorL({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
            door_id: 1,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.chageequipmentpopup = true;
      });
    },
    //查看指引图片
    lookimg() {
      this.lookpopup = true;
    },
    closeDialog() {
      this.addseathDialog = false;
    },
    submitForm(formName) {
      let that = this;
      // let params = {
      //   store_id:JSON.parse(localStorage.getItem("storemenu"))[0].id,
      //   num:that.addformInfo.seatnum,
      //   genre_id:that.addformInfo.seattype
      // }
      that.$refs[formName].validate((valid) => {
        if (valid) {
          storeSeniorSeatA({
            request_data: Base64.encode(
              JSON.stringify({
                store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
                num: that.addformInfo.seatnum,
                genre_id: that.addformInfo.seattype,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              that.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            that.addseathDialog = false;
            that.$refs[formName].resetFields();
            that.getsellsetdata();
          });
        } else {
          return false;
        }
      });
    },
    editsubmitForm(editformInfo) {
      let that = this;
      let params = {
        seat_id: that.seat_id,
        seat_name: that.editformInfo.seat_name,
      };
      that.$refs[editformInfo].validate((valid) => {
        if (valid) {
          storeSeatNameEdit({
            request_data: Base64.encode(JSON.stringify(params)),
          }).then((res) => {
            if (res.status == 2) {
              that.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            that.editseathDialog = false;
            that.getsellsetdata();
          });
        } else {
          return false;
        }
      });
    },
    submitFormtyppinstall(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          storeSeniorGenreE({
            request_data: Base64.encode(
              JSON.stringify({
                id: this.typpinstall.id,
                reserve: 0,
                seat: this.typpinstall.seat,
                price: this.typpinstall.price,
                minute: this.typpinstall.minute,
                vertex: this.typpinstall.vertex,
                desc: this.typpinstall.desc,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            if (res.status == 1) {
              this.installDialog2 = false;
              this.$message({
                type: "success",
                message: res.message,
              });
              this.getsellsetdata(1);
            }
          });
        } else {
          return false;
        }
      });
    },
    showbtns() {
      this.isdel = !this.isdel;
    },
    submitFormaddroominfo(formName) {
      if (this.addroominfo.canday === "0") {
        this.$message({
          message: "预定天数需大于0",
          type: "warning",
        });
        return;
      }
      this.$refs[formName].validate((valid) => {
        if (valid) {
          storeSeniorRoomA({
            request_data: Base64.encode(
              JSON.stringify({
                id: 0,
                store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
                room_name: this.addroominfo.roomname,
                price: this.addroominfo.roomprice,
                num: this.addroominfo.seatingnum,
                // advance_time: this.addroominfo.advanceroom,
                set_time: this.addroominfo.canday,
                minutes: this.addroominfo.oneminute,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.addroompopup = false;
            this.getsellroomlist();
            setTimeout(() => {
              this.getlists();
              this.$refs[formName].resetFields();
            }, 500);
          });
        } else {
          return false;
        }
      });
    },
    //编辑房间确定
    submitFormeditroominfo(formName) {
      if (this.editroominfo.set_time === "0") {
        this.$message({
          message: "预定天数需大于0",
          type: "warning",
        });
        return;
      }
      this.$refs[formName].validate((valid) => {
        if (valid) {
          storeSeniorRoomA({
            request_data: Base64.encode(
              JSON.stringify({
                id: this.editroominfo.id,
                store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
                room_name: this.editroominfo.room_name,
                price: this.editroominfo.price,
                num: this.editroominfo.num,
                // advance_time: this.editroominfo.advance_time,
                set_time: this.editroominfo.set_time,
                minutes: this.editroominfo.minutes,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.editroompopup = false;
            this.getsellroomlist();
            setTimeout(() => {
              this.getlists();
            }, 500);
          });
        } else {
          return false;
        }
      });
    },
    submitFormaddappointment(formName) {
      let that = this;
      this.$refs[formName].validate((valid) => {
        if (valid) {
          storeSeniorRoomM({
            request_data: Base64.encode(
              JSON.stringify({
                id: that.editroomid,
                store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
                phone: that.addappointment.kehuphone,
                start_time:
                  that.addappointment.stardate +
                  " " +
                  that.addappointment.startime,
                end_time:
                  that.addappointment.stardate +
                  " " +
                  that.addappointment.endtime,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            if (res.status == 1) {
              this.$message({
                type: "success",
                message: "预约成功!",
              });
            }
            that.addappointmentpopup = false;
          });
        } else {
          return false;
        }
      });
    },
    submitFormaddcontainerDialog(formName) {
      let that = this;
      this.$refs[formName].validate((valid) => {
        if (valid) {
          storeSeniorContainerA({
            request_data: Base64.encode(
              JSON.stringify({
                store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
                num: that.addcontainerInfo.containernum,
                devno: that.addcontainerInfo.containerid,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              that.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            that.addcontainerDialog = false;
            that.getsellBox();
            setTimeout(() => {
              that.getlists();
              that.$refs[formName].resetFields();
            }, 500);
          });
        } else {
          return false;
        }
      });
    },
    submitFormchargedata(formName) {
      let that = this;
      this.$refs[formName].validate((valid) => {
        if (valid) {
          storeSeniorContainerE({
            request_data: Base64.encode(
              JSON.stringify({
                id: "",
                free_time: "",
                price: "",
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              that.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            that.chargeDialog = false;
          });
        } else {
          return false;
        }
      });
    },
    submitFormincabinetdata(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          storeSeniorContainerZhan({
            request_data: Base64.encode(
              JSON.stringify({
                container_id: this.zhanid,
                store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
                phone: this.incabinetdata.users,
                // money:this.incabinetdata.incabinetprice,
                start_time: this.incabinetdata.incabinettime / 1000,
                end_time: this.incabinetdata.incabinettimes / 1000,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.incabinetpopup = false;
            this.getsellBox();
          });
        } else {
          return false;
        }
      });
    },
    submitFormcontroldata(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.controlDialog = false;
        } else {
          return false;
        }
      });
    },
    submitFormthingsstate(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.coninstallpopup = false;
        } else {
          return false;
        }
      });
    },
    //高级设置
    saveseniorEdit() {
      // console.log(this.imageUrl)
      // return;
      let newimgarr = [];
      this.fileLists.map((v) => {
        newimgarr.push(v.url);
      });
      storeSeniorEdit({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
            store_img: newimgarr.join(","),
            location_img: this.imageUrl,
            facility: this.avcReturndata.facility,
            conduct: this.avcReturndata.conduct,
            study_img: this.imageUrls,
            store_activity: this.imageUrlatv,
            container_code: this.avcReturndata.container_code,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.addappointmentpopup = false;
        this.$message({
          message: res.message,
          type: "success",
        });
      });
    },
    controlinstall() {
      this.controlDialog = true;
    },
    installed(val) {
      this.typpinstall = val;
      this.installDialog2 = true;
    },
    // chargeinstalled() {
    //   this.chargeDialog = true;
    // },
    addroom() {
      // this.getselllist()
      this.addroompopup = true;
    },
    // getselllist(){
    //   storeGenreType({
    //     request_data: Base64.encode(
    //       JSON.stringify({
    //         ids:0
    //       })
    //     )
    //   }).then(res => {
    //     console.log(res);
    //     // this.roomseatoptions = res.result
    //   });
    // },
    del(val) {
      this.$confirm("确定删除此条数据吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          storeSeniorRoomD({
            request_data: Base64.encode(
              JSON.stringify({
                id: val.id,
              })
            ),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.$message({
              type: "success",
              message: "删除成功!",
            });
            this.getsellroomlist();
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    addappointmentstate(index, data) {
      this.addappointmentpopup = true;
      this.editroomid = data.id;
    },
    //相册
    showimg(val) {
      this.imgtypeDialog = true;
      this.srcList = val.img;
      this.img_id = val.store_room_id;
      this.room_id = val.id;
      if (val.img) {
        let objimg = val.img;
        objimg.forEach((item) => {
          let obj = {
            url: item,
          };
          this.showimglist.push(obj);
        });
      }
      // this.showimgpoptitle = val.title
      this.imgtypeDialog = true;
    },
    handleClose() {
      this.showimglist = [];
    },
    handimg(res, file) {
      this.showimglist.push({
        url: res.file_path,
      });
    },
    handimgRemove(file, fileList) {
      let filePath = file.url;
      let i = this.showimglist.findIndex((x) => x.url == filePath);
      // 3.调用splice方法，移除图片信息
      this.showimglist.splice(i, 1);
    },
    config() {
      let newimgarr = [];
      this.showimglist.map((v) => {
        newimgarr.push(v.url);
      });
      // console.log(this.showimglist)
      // console.log(newimgarr)
      // return
      if (this.img_id == "") {
        let parmes = {
          store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
          room_id: this.room_id,
          img: newimgarr.join(","),
        };
        album({
          request_data: Base64.encode(JSON.stringify(parmes)),
        }).then((res) => {
          if (res.status == 2) {
            this.$message({
              message: res.message,
              type: "warning",
            });
            return;
          }
          this.imgtypeDialog = false;
          this.getsellroomlist();
          // this.reload();
        });
      }
      if (this.img_id != "") {
        let parmes = {
          store_room_id: this.img_id,
          img: newimgarr.join(","),
        };
        albumEdit({
          request_data: Base64.encode(JSON.stringify(parmes)),
        }).then((res) => {
          if (res.status == 2) {
            this.$message({
              message: res.message,
              type: "warning",
            });
            return;
          }
          this.imgtypeDialog = false;
          this.getsellroomlist();
          // this.reload();
        });
      }
    },
    //编辑房间
    editroom(index, data) {
      this.editroomid = data.id;
      this.editroompopup = true;
      this.editroominfo = JSON.parse(JSON.stringify(data));
    },
    // 设备详情
    // coninstall(item) {
    //   this.coninstallpopup = true;
    //   this.statetitle = item.name + "详情";
    //   this.thingsstate.textarea = item.content;
    //   // this.thingtextarea = item.content
    // },
    // 添加货柜
    addcontainer() {
      this.addcontainerDialog = true;
    },
    // 货柜收费设置
    containerinstall() {
      this.chargeDialog = true;
    },
    //刷新货柜
    shuaguide() {
      let parmes = {
        store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
      };
      storeSeniorContainerRefresh({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.$message({
          type: "success",
          message: res.message,
        });
        this.imgtypeDialog = false;
        this.getsellBox();
        // this.reload();
      });
    },
    //修改
    saveformdata(formName) {
      if (this.ruleForm.store_name == "") {
        this.$message({
          message: "请输入门店名称",
          type: "warning",
        });
        return;
      }
      if (this.ruleForm.type.length == 0) {
        this.$message({
          message: "请选择座位类型",
          type: "warning",
        });
        return;
      }
      if (this.ruleForm.phone == "") {
        this.$message({
          message: "请输入联系电话",
          type: "warning",
        });
        return;
      }
      if (this.startTime1 == null) {
        this.$message({
          message: "请选择营业时间",
          type: "warning",
        });
        return;
      }
      if (this.ruleForm.wechat_link == "") {
        this.$message({
          message: "请输入客服链接",
          type: "warning",
        });
        return;
      }
      // this.$refs[formName].validate(valid => {
      // if (valid) {
      storeEdit({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: JSON.parse(localStorage.getItem("storemenu"))[0].id,
            store_name: this.ruleForm.store_name,
            type: this.ruleForm.type.join(","),
            phone: this.ruleForm.phone,
            // start_time: this.ruleForm.start_time,
            // end_time: this.ruleForm.end_time,
            start_time: this.startTime1[0] || "",
            end_time: this.startTime1[1] || "",
            rest_time: this.rest_time || "",
            temp_start_time: this.bool ? this.value1[0] : 0,
            temp_end_time: this.bool ? this.value1[1] : 0,
            unlock_time: 0,
            // choose_time: this.ruleForm.choose_time,
            choose_time: 0,
            address: this.ruleForm.address,
            distance: this.ruleForm.distance,
            wifi_name: this.ruleForm.wifi_name,
            wifi_code: this.ruleForm.wifi_code,
            // wx_code: this.ruleForm.wx_code,
            wechat_link: this.ruleForm.wechat_link,
            wx_image: this.ruleForm.wx_image,
            guide_image: this.storeimageUrl,
            facility: this.ruleForm.facility_id.join(","),
            lng: this.coordinate.lng,
            lat: this.coordinate.lat,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.$message({
          type: "success",
          message: "修改成功",
        });
        this.getstoreList(
          JSON.parse(localStorage.getItem("storemenu"))[0].id,
          1,
          10
        );
      });
      // } else {
      //   return false;
      // }
      // });
    },
  },
};
</script>

<style scoped lang="scss" scoped>
.titbox {
  width: 100%;
}

.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),
.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),
.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),
.el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  padding-left: 20px;
}

.items {
  margin-left: 40px;
}

.line {
  text-align: center;
}

.box1 {
  margin-bottom: 24px;
}

.inpts {
  -webkit-appearance: none;
  background-color: #fff;
  background-image: none;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  display: inline-block;
  font-size: inherit;
  height: 40px;
  line-height: 40px;
  outline: 0;
  padding: 0 15px;
  -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  width: 98%;
  color: #409eff;
  font-size: 12px;
  padding-left: 16px;
}

.ghost {
  background: #f5f7fa !important;
  box-shadow: 1px 0 12px rgba(0, 0, 0, 0.3) !important;
}

.contbox {
  width: 100%;
  height: auto;
  margin-top: 24px;
  margin-left: 20px;
}

.tit1 {
  border-bottom: 1px solid #f0f2f5;
  width: 100%;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.store_23 {
  display: none;
}

.store_24 {
  display: none;
}

.tx1 {
  margin-left: 10px;
  margin-right: 16px;
  color: #010101;
  font-size: 16px;
}

.tx2 {
  color: #afafaf;
  font-size: 12px;
}

.tx3 {
  color: #69e;
  font-size: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  display: inline-block;
}

.flex_bottombox {
  margin-bottom: 40px;
}

.myQuillEditor {
  margin-left: 10px;
  height: 500px;
  width: 98%;
}

.mapbox {
  width: 98%;
  margin: 0 auto;
  height: 400px;
}

.el-upload-list--picture-card .el-upload-list__item {
  width: 180px;
}

.el-upload--picture-card {
  width: 180px;
}

.el-dialog__body {
  text-align: center;
}

// .avatar-uploader {
//   border: 1px dashed #d9d9d9;
//   border-radius: 6px;
//   cursor: pointer;
//   position: relative;
//   overflow: hidden;
//   width: 180px;
//   height: 148px;
// }
// .avatar-uploader:hover {
//   border-color: #409eff;
// }
// .avatar-uploader-icon {
//   font-size: 28px;
//   color: #8c939d;
//   width: 180px;
//   height: 148px;
//   line-height: 148px;
//   text-align: center;
// }
::v-deep .disabled .el-upload--picture-card {
  display: none !important;
}

.avatar {
  width: 180px;
  height: 148px;
  display: block;
}

::v-deep .el-tabs__nav-scroll {
  margin-left: 10px;
}

.item {
  position: relative;
  border-radius: 6px;
  background-color: #fdfdfd;
  border: solid 1px #eee;
  margin-bottom: 10px;
  width: 148px;
  height: 148px;
  display: inline-block;
  margin-right: 10px;
  cursor: move;
}

/*选中样式*/
.chosen {
  border: solid 1px #3089dc !important;
}
</style>
